$(function(){
	$.ajax({
		url:'../ticketController/myTickets',
		success:function(data){
			
			if(data==null || data=="" ||data.length==0){
				 $(".box").html("<div><img src='../image/none.jpg' style='width: 300px;height:300px;margin-left: 225px;margin-top:100px;'></div>");
			}else{
				 $(".box").html("");
					$.each(data,function(idex,item){
						var outTime="";
						var access="";
						var getTime="";
						getTime=new Date(item.getTime).format("yyyy-MM-dd hh:mm:ss");
						if(item.outTime!=null){
							outTime=new Date(item.outTime).format("yyyy-MM-dd hh:mm:ss");
						}else{
							outTime="无";
						}
						if(item.access=="1"){
							access="任务获取"
						}else if(item.access=="2"){
							access="不凡币兑换"
						}else if(item.access=="3"){
							access="退票"
						}
						$(".box").append("<div class='ticket' style='background:url(../image/myTicketBack.png) no-repeat;background-size: 100% 100%;'> <div class='left'><div class='title'>"+item.ticket+"</div><div class='getTime'><label>获得时间：</label>"+getTime+"</div><div class='endTime'><label>到期时间：</label>"+outTime+"</div></div><div class='right'>"+access+"</div></div>");
				})
			}
		}
	})
})